import Foundation


struct Job {

    static var tableName: String = "jobs"
    static let encoder = JSONEncoder()
    static let decoder = JSONDecoder()

    var orderId: Int?
    let jobId: String
    let priority: Int
    let action: String

    let userId: String?
    let blazeMessage: Data?
    let conversationId: String?
    let resendMessageId: String?
    var runCount: Int = 0

    var isAutoIncrement = true
}

enum JobPriority: Int {
    case SEND_MESSAGE = 18
    case RESEND_MESSAGE = 15
    case SEND_DELIVERED_ACK_MESSAGE = 7
    case SEND_ACK_MESSAGE = 5
}

enum JobAction: String {
    case REQUEST_RESEND_KEY
    case REQUEST_RESEND_MESSAGES
    case RESEND_MESSAGE
    case RESEND_KEY
    case SEND_NO_KEY
    case SEND_KEY
    case SEND_MESSAGE
    case SEND_ACK_MESSAGE
    case SEND_DELIVERED_ACK_MESSAGE
}


